package com.yoda.mall.mysql.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yoda.mall.api.RolePermissionRelationApi;
import com.yoda.mall.model.entity.ums.RolePermissionRelation;
import com.yoda.mall.mysql.mapper.RolePermissionRelationMapper;
import com.yoda.mall.mysql.mapper.RoleResourceRelationMapper;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

@DubboService
public class RolePermissionRelationApiImpl implements RolePermissionRelationApi {
    @Resource
    private RolePermissionRelationMapper rolePermissionRelationMapper;

    @Override
    public void deleteByRoleId(int id) {
        LambdaQueryWrapper<RolePermissionRelation> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(RolePermissionRelation::getRoleId,id);
        rolePermissionRelationMapper.delete(wrapper);
    }
}